<!DOCTYPE html>
<html class="layui-bg-white">
<head th:include="include :: header"></head>
<body>
<div class="layui-form" style="padding:20px;">
    <input id="icon" name="icon" type="hidden" >
    <input id="parentId" name="parentId" type="hidden" th:value="${parentId}">
    <div class="layui-form-item">
        <label class="layui-form-label">父级菜单：</label>
        <div class="layui-input-block">
            <input type="text" autocomplete="off" class="layui-input" th:value="${parentName}" readonly>
        </div>
    </div>
    <div class="layui-row layui-form-item">
        <div class="layui-col-sm6">
            <label class="layui-form-label">菜单类型：</label>
            <div class="layui-input-block">
                <input type="radio" name="type" value="0" title="目录" checked>
                <input type="radio" name="type" value="1" title="菜单">
                <input type="radio" name="type" value="2" title="按钮">
            </div>
        </div>
        <div class="layui-col-sm6">
            <label class="layui-form-label">菜单图标：</label>
            <div class="layui-input-block">
                <input type="text" id="iconpicker" lay-filter="iconpicker" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><span class="required">*</span>菜单名称：
        </label>
        <div class="layui-input-block">
            <input type="text" name="name" lay-verify="required" placeholder="请输入菜单名称" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">链接地址：</label>
        <div class="layui-input-block">
            <input type="text" name="url" placeholder="请输入链接地址" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">权限标识：</label>
        <div class="layui-input-block">
            <input type="text" name="perms" placeholder="请输入权限标识" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">排列序号：</label>
        <div class="layui-input-block">
            <input type="text" name="sortNumber" placeholder="请输入排列序号" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit lay-filter="LAY-operate-submit" id="LAY-operate-submit" value="确认">
    </div>
</div>
<div th:include="include :: footer"></div>
<script type="text/javascript">
    layui.config({
        base: ctx + '/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index',         //主入口模块
        iconpicker: 'iconpicker'
    }).use(['index', 'form', 'iconpicker'], function () {
        var $ = layui.$, form = layui.form, iconpicker = layui.iconpicker;

        form.verify(commonJs.form.verify);

        //图标选择器
        iconpicker.render({
            // 选择器，推荐使用input
            elem: '#iconpicker',
            // 数据类型：fontClass/unicode，推荐使用fontClass
            type: 'fontClass',
            // 是否开启搜索：true/false
            search: true,
            // 是否开启分页
            page: true,
            // 每页显示数量
            limit: 12,
            // 点击回调
            click: function (data) {
                $('#icon').val("layui-icon " + data.icon);
            }
        });
        iconpicker.checkIcon('iconpicker', '');
    });
</script>
</body>
</html>

